home
***
CD-ROM
|
disk
|
other
***
search
/
SGI Hot Mix 8
/
Hot Mix 8.iso
/
.all
/
demos
/
ICS
/
addbxkey.lm
(
.txt
)
next >
Wrap
Text File
|
1994-06-22
|
12KB
|
470 lines
#!/bin/sh
SYSTEM=sgi5
case $SYSTEM
in
mips | mips-cd | ibm | ibm-cd | ds3100 | ds3100-cd | sgi | sgi-cd | sgi5 | sgi5-cd | sco | sco-cd | hp700 | hp700-cd | osf | osf-cd )
DASHN=""
SLASHC=" \c"
;;
* )
DASHN="-n"
SLASHC=" "
;;
esac
Clear()
{
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
}
Title()
{
echo "================================================================================"
echo "$1"
echo "================================================================================"
}
Status()
{
echo ""
echo "[1] License Data File: ${LMLICFILE}"
echo ""
echo "[2] License Type: ${LICTYPE} Feature License"
echo "[3] License Version: ${VERSION}"
echo "[4] Expiration Date: ${EXPDATE}"
echo "[5] Number of Licenses: ${LICUSERS}"
echo "[6] Activation Key: ${ACTKEY}"
}
InstallHelp()
{
Title "License Activation Key Installation Help: $HELPTITLE"
case "$HELP"
in
addmain )
echo ""
echo ""
echo ""
echo "This menu allows you to modify the various parameters involved with installing"
echo "a Builder Xcessory license activation key."
echo ""
echo "The license data file is the file that contains all the licensing information."
echo "The license type is FULL, ADA or DEMO. If you are using the Flexible"
echo "License manager installed by another vendor's product, you can use the DEMO"
echo "setting to set up the demo version of BX. The License Version is the"
echo "version of the Builder Xcessory for which you are installing a key. Minor"
echo "release of Builder Xcessory do not require changes in licensing, and thus are"
echo "not indicated in the BX version string. Therefore, when installing a key for"
echo "BX Version 3.0A, the version string to use is 3.000. Number of licenses is"
echo "the number of licenses encoded in the activation string. Finally, the"
echo "activation key is the encrypted key to use the licenses of BX."
echo ""
echo ""
echo ""
echo ""
AwaitEnter
;;
datafile )
echo ""
echo ""
echo "The License Data File is the configuration file for the Flexible License"
echo "Manager. It contains the list of the machines acting as license servers, a"
echo "list of all vendor daemons controlled by the license servers, and a list of"
echo "all supported products (or FEATUREs). This script is used to modify the list"
echo "of FEATUREs. The script will add the Builder Xcessory FEATURE line if it does"
echo "not exist or modify the line if it does exist in the file."
echo ""
echo ""
echo "NOTE: Because many vendors use the Flexible License Manager and most expect"
echo " the license data file in a different location, be sure that you specify"
echo " the license data file which contains the correct list of license"
echo " servers. If the list in the data file does not match the list encoded"
echo " in the license activation key, the license manager will not grant any"
echo " licenses."
echo ""
echo ""
echo ""
echo ""
AwaitEnter
;;
bxver )
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo "The Builder Xcessory Version is the MAJOR version number of BX for which the"
echo "license activation key was generated. This means that BX Version 3.0 and"
echo "BX Version 3.0A both use the same version string: 3.000"
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
AwaitEnter
;;
expdate )
echo ""
echo ""
echo ""
echo ""
echo "The License Expiration Date is the date on which BX license will expire."
echo "Under normal conditions, ICS issues open-ended licenses, that is, licenses"
echo "with no expiration date. An unexpiring license is indicated by a year of 00."
echo ""
echo "When entering the expiration date (for BETA and EVALUATION software), user the"
echo "format: dd-mmm-yy; where dd is a two digit day of the month."
echo " mmm is a three character month from the list -"
echo " jan, feb, mar, apr, may, jun"
echo " jul, aug, sep, oct, nov, dec"
echo " yy is a two digit year."
echo ""
echo "When installing a DEMO license, this value need not be entered."
echo ""
echo ""
echo ""
echo ""
AwaitEnter
;;
licuse )
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo "The Number of Licenses is the number of licenses encoded in the license"
echo "activation key. It is the number of simultaneous users that the license"
echo "manager will allow to use the Builder Xcessory."
echo ""
echo "When installing a DEMO license, this value need not be entered."
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
AwaitEnter
;;
actkey )
echo ""
echo "The License Activation Key is a 20 character code which allows the license"
echo "manager to grant licenses for a specific version of a software product based"
echo "on the number of available licenses and expiration date of those licenses."
echo "It is very important to enter this key exactly as it was given to you."
echo "Encoded in the license activation key are:"
echo ""
echo " The list of license servers"
echo " The version of the Builder Xcessory"
echo " The number of simultaneous users to allow"
echo " The expiration date of the licenses"
echo ""
echo "If any of the data do not match what was encoded into the activation key, the"
echo "key will be considered invalid by the license manager and a \"Bad Key\" error"
echo "message will be entered in the license manager log file."
echo ""
echo "When installing a DEMO license, this value need not be entered. A valid key"
echo "will be used regardless of what is entered."
echo ""
echo ""
AwaitEnter
;;
* )
;;
esac
Clear
}
PromptUser()
{
CONTINUE=NO
while test "$CONTINUE" = "NO"
do
echo "$1 (? for Help)"
echo ${DASHN} "[$2]->${SLASHC}"
read INPUT
case "$INPUT"
in
\? )
InstallHelp
;;
* )
if test "$INPUT" = ""
then
USERPROMPT="$2"
else
USERPROMPT="$INPUT"
fi
CONTINUE=YES
;;
esac
done
}
AwaitEnter()
{
ESCAPE=N
echo ${DASHN} "Press [ENTER] to continue [X] to escape...${SLASHC}"
read INPUT
case "$INPUT"
in
[xX] )
ESCAPE=Y
;;
* )
ESCAPE=N
;;
esac
}
LMLICDIR=
LICTYPE=FULL
VERSION=3.000
EXPDATE=01-jan-00
LICUSERS=1
ACTKEY=""
ACTKEYOK=N
LMLICFILE="/usr/local/flexlm/licenses/license.dat"
DEMOFEAT=BuilderXcessoryDemo
FULLFEAT=BuilderXcessory
DAEMON=ICSBX
BXSTRING="ICS Builder Xcessory"
ADASTRING="ICS BX/Ada"
GO=NO
while test "${GO}" = "NO"
do
CONT=NO
while test "${CONT}" = "NO"
do
HELP=addmain
HELPTITLE="Main Menu"
Clear
Title "Flexible License Manager License Key Installation"
echo ""
Status
echo ""
echo ""
echo "1. Change license data file."
echo "2. Change license type."
echo "3. Change the license version."
echo "4. Change the license expiration date."
echo "5. Change the number of licenses."
echo "6. Change activation key"
echo "I. Install this key."
echo "Q. Quit"
echo ""
echo ${DASHN} "Selection (? for Help):${SLASHC}"
read Z
case "$Z"
in
[Qq] )
echo Quit by user from menu.
exit
;;
[Ii] )
if test "$ACTKEYOK" = "N" -a "$LICTYPE" = "FULL"
then
Clear
Title "ERROR - No Activation Key"
echo ""
echo ""
echo "You must enter a 20 character activation key in order to proceed."
echo ""
echo ""
AwaitEnter
else
ACTKEYOK=Y
CONT=YES
fi
;;
1 )
HELP=datafile
HELPTITLE="License Data File"
PromptUser "Enter the license data file." "${LMLICFILE}"
if [ -f "${USERPROMPT}" -a -w "${USERPROMPT}" ]
then
LMLICFILE="${USERPROMPT}"
else
Clear
Title "ERROR - Invalid License Data File"
echo ""
echo ""
echo "${USERPROMPT} does not exist or is not writable."
echo ""
echo "If this is the correct file, verify that it exists on this system and that"
echo "it is writable by you."
echo ""
echo "The license data file has not been changed."
echo ""
echo ""
AwaitEnter
fi
;;
2 )
if test "$LICTYPE" = "FULL"
then
LICTYPE=ADA
elif test "$LICTYPE" = "ADA"
then
LICTYPE=DEMO
else
LICTYPE=FULL
fi
;;
3 )
HELP=bxver
HELPTITLE="Builder Xcessory Version"
PromptUser "Enter the Builder Xcessory version." "${VERSION}"
VERSION="$USERPROMPT"
;;
4 )
HELP=expdate
HELPTITLE="License Expiration Date"
echo "Use the date format: dd-mmm-yy"
echo "Valid entries for 'mmm':"
echo " jan feb mar apr may jun"
echo " jul aug sep oct nov dec"
echo ""
PromptUser "Enter the license expiration date." "${EXPDATE}"
EXPDATE="$USERPROMPT"
;;
5 )
HELP=licuse
HELPTITLE="Number of Licenses"
PromptUser "Enter the number of licenses." "${LICUSERS}"
LICUSERS="$USERPROMPT"
;;
6 )
HELP=actkey
HELPTITLE="License Activation Key"
PromptUser "Enter the license activation key." "${ACTKEY}"
ACTKEYLEN=`echo "$USERPROMPT" | wc -c`
if test "$ACTKEYLEN" -ne 21
then
Clear
Title "ERROR - Activation Key"
echo ""
echo ""
echo "The activation key must be exactly 20 characters in length."
echo ""
echo ""
AwaitEnter
ACTKEYOK=N
else
ACTKEYOK=Y
ACTKEY="$USERPROMPT"
fi
;;
\? )
InstallHelp
;;
* )
;;
esac
done
if [ -f "${LMLICFILE}" -a -w "${LMLICFILE}" ]
then
GO=YES
else
Clear
Title "ERROR - License Data File"
echo ""
echo ""
echo "${LMLICFILE} does not exist or is not writable."
echo ""
echo "If this is the correct file, verify that it exists on this system and that"
echo "it is writable by you."
echo ""
echo ""
AwaitEnter
GO=NO
CONT=NO
fi
done
Clear
Title "Installing"
echo ""
if test "${LICTYPE}" = "DEMO"
then
FEATURELINE="FEATURE ${DEMOFEAT} ${DAEMON}"
else
FEATURELINE="FEATURE ${FULLFEAT} ${DAEMON}"
fi
egrep -ve "$FEATURELINE" ${LMLICFILE} >> /tmp/tmp.dat
mv /tmp/tmp.dat ${LMLICFILE}
if test "${LICTYPE}" = "DEMO"
then
ACTKEY="9B14907184E1C37F9BF8"
FEATURE="${FEATURELINE} ${VERSION} ${EXPDATE} ${LICUSERS} ${ACTKEY} \"${BXSTRING} Demo\" DEMO"
elif test "${LICTYPE}" = "ADA"
then
FEATURE="${FEATURELINE} ${VERSION} ${EXPDATE} ${LICUSERS} ${ACTKEY} \"${ADASTRING}\""
else
FEATURE="${FEATURELINE} ${VERSION} ${EXPDATE} ${LICUSERS} ${ACTKEY} \"${BXSTRING}\""
fi
echo "The following line is being placed in ${LMLICFILE}:"
echo ""
echo $FEATURE
echo ${FEATURE} >> ${LMLICFILE}
echo ""
echo "Flexible License Manager License Key Installation Complete."
echo ""
echo "If the lmgrd is already running, you can use the lmreread utility to add the"
echo "Builder Xcessory FEATURE. If this the first time any ICS license has been"
echo "added to the license data file, you will have to stop and restart the license"
echo "manager using lmdown in order to start the ICSBX vendor daemon."